var fileSave = require('file-save');

// the first line will create a writeStream to the file path
fileSave('sample/test.txt')
  .write('this is the first line', 'utf8')
  .write('this is the second line', 'utf8', function() {
    console.log('writer callback');
  })
  .end('this is the end')
  .error(function() {
    console.log('error goes here');
  });
